The present invention is concerned with methods of producing object-based design descriptions for embroidery patterns from bitmaps or similar image formats.
Embroidery designs, when created using computer software, are typically defined by many small geometric or enclosed curvilinear areas. Each geometric area may be defined by a single embroidery data object comprising information such as the object outline, stitch type, color and so on.
For example, a rectangular area of satin stitches might be defined in an embroidery object by the four control points that make up its four corners, and a circle area of fill stitches might be defined by two control points, the center of the circle and a point indicating the radius. A more complex shape would normally be defined by many control points, spaced at intervals along the boundary of the shape. These control points may subsequently be used to generate a continuous spline approximating the original shape.
Having generated an object-based design description, conversion software is used to convert the embroidery objects into a vector-based stitch design which is then used to control an embroidery machine. Such stitch designs contain a sequence of individual stitch instructions to control the embroidery machine to move an embroidery needle in a specified manner prior to performing the next needle insertion. Apart from such vector data, stitch instructions may also include data instructing the embroidery machine to form a thread color change, a jump stitch or a trim.
The derivation of discrete geometric areas for creating embroidery objects from a bitmap or other image format is conventionally carried out by the user of a suitably programmed computer by entering a large number of control points, typically through superposition on a display of the image. However, manual selection of control points is a time consuming and error prone process. It would therefore be desirable to automate the derivation of control points and the construction of the object-based design description from a bitmap or similar image format.
WO99/53128 discloses a method for converting an image into embroidery by determining grain structures in the image using fourier transforms and stitching appropriate uni-directional or bi-directional grain structures accordingly. The document also proposes determining a xe2x80x9cthinnessxe2x80x9d parameter for different regions within an image, and selecting an appropriate stitch type for each region based on this parameter. However, the document does not address the problem of how to automatically process particular regions of an image to generate embroidery objects suitable for stitching.
The present invention provides a method of operating a computer to produce an object-based description of an embroidery pattern subject, from a subject bitmap describing the subject, the method comprising the steps of:
analyzing the subject bitmap to identify a skeleton of the subject;
analyzing the skeleton to identify a plurality of nodes interlinked by a plurality of paths;
traversing the skeleton by following the paths and nodes; and
during the traversal, generating a series of objects describing the subject for the object-based description.
The embroidery pattern subject may typically be a graphical element taken from a digital image, or a simple graphical element such as an alphanumeric character or other symbol. The invention provides a method of producing an object-based description of the subject from which a stitch-based description can be generated, which in turn can be used to control an embroidery machine to stitch out the subject in an attractive and efficient manner.
For the purposes of carrying out the invention, the subject is provided as a subject bitmap. The active, or colored pixels of the bitmap which represent the subject should preferably be continuous in the sense that all active pixels are interconnected. A complex or broken subject can, of course, be represented as a number of different subject bitmaps which can be processed independently.
Usually, the subject bitmap and object-based descriptions will be stored as computer data files. Intermediate data such as the skeleton, the nodes and the paths may be stored as data files or only as temporary data structures in volatile memory.
Preferably the step of traversal includes the steps of: starting at a selected node; and moving between nodes by following the paths interlinking the nodes in such a manner that each path is traversed a first time and a second time. In particular, by traversing each path only twice an efficient stitching out process and attractive end product can be obtained.
Preferably, the step of generating includes the steps of: when a path is traversed for the first time, generating for the path an object having a first stitch type; and when a path is traversed for the second time, generating for the path an object having a second stitch type.
In one embodiment, where the subject is to be stitched out in a linear stitch type such as a running stitch or variant thereof such as a double or quadruple stitch, both the first and second stitch types are linear stitch types.
In,another embodiment, where the subject is to be stitched out using an area-filling stitch, the first stitch type is preferably a linear stitch type which is subsequently overstitched by the area-filling stitch type. The area-filling stitch type most likely to be used in embodiments of the invention is satin stitch, but others such as fill stitch may also be used.
If an area filling stitch is to be used, then preferably the method further comprises the steps of: analyzing the subject bitmap to identify an outline of the subject, and using the outline to define at least a part of the boundary of at least some of the generated objects of the area filling stitch type.
Preferably, the step of analyzing the subject bitmap to identify a skeleton of the subject comprises the step of applying a thinning algorithm to a copy of the subject bitmap to generate the skeleton. Advantageously, a Xhang-Suen type stripping algorithm may be used for this purpose.
Preferably, a preliminary step of expanding the subject bitmap is carried out to ensure that the derived skeleton paths can pass along narrow channels of the subject without interference with or from the derived outline. The expansion is preferably by means of an interpolation routine, to retain the curvature of the original subject. An expansion factor of three or more may be used, but a factor of five is preferred.
The invention also provides computer apparatus programmed to produce an object-based description of an embroidery pattern subject, from a subject bitmap describing the subject, by processing the subject bitmap according to the method of any preceding claim.
Computer program instructions for carrying out the method may be stored on a computer readable medium such as a floppy disk or CD ROM, as may be a file containing an object-based description produced using the method, or a file containing a vector-based stitch description created from such an object-based description.